#include<stdio.h>
#include<string.h>
int main (void)
{
    int money = 0, change = 0, i = 0, sum=0;
    int n, count[11] = {0}, price[11]={0,1,1,1,2,2,3,3,3,4,4};
    char a[11][20]={"0","Table-water","Table-water","Table-water","Coca-Cola","Milk","Beer","Oolong-Juice","Sprite","Oolong-Tea","Green-Tea"};

    while(1)
{
        scanf("%d", &n);
        
        if(n == -1)
        break;
            
        money += n;       
    
    }   

    while(1)
    {
        scanf("%d", &n);
        
        if(n == -1)
        break;
        
        count[n]++;        
    }
    
    for(i = 1;i < 11;i++)
    {
        sum += price[i] * count[i];      
    }
    
    if(sum > money)      
    {
        printf("Insufficient money");
        
        return 0;
    }
    
    printf("Total:%dyuan,change:%dyuan\n", money, money - sum);     
    
    for(i = 1;i < 11;i++)      
    {
        if(count[i] != 0)
        {
            printf("%s:%d;", a[i], count[i]);
        }
    }
    
    return 0;
}
